package com.lzy.huijinjiazu.mvp.ui.widget;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.jess.arms.base.App;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.http.imageloader.glide.ImageConfigImpl;
import com.youth.banner.loader.ImageLoaderInterface;


/**
 * Created by Administrator on 2017/3/7.
 */

public class BannerGridLoader implements ImageLoaderInterface {


    @Override
    public void displayImage(Context context, Object path, View imageView) {
//        AppComponent appComponent = ((App) imageView.getContext().getApplicationContext()).getAppComponent();
//        ImageLoader imageLoader = appComponent.imageLoader();
//
//        imageLoader.loadImage(appComponent.appManager().getCurrentActivity() == null
//                        ? appComponent.application() : appComponent.appManager().getCurrentActivity(),
//                ImageConfigImpl
//                        .builder()
//                        .url(path.toString())
//                        .imageView((ImageView) imageView)
//                        .build());

        Glide.with(context).load(path).into((ImageView) imageView);

    }

    @Override
    public View createImageView(Context context) {
        ImageView imageView = new ImageView(context);
        return imageView;
    }
}
